<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('库存列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="user-form">
                <input type="hidden" id="deptId" name="deptId">
                <input type="hidden" id="parentId" name="parentId">
                <div class="select-list">
                    <ul>
<!--                        <li>-->
<!--                            <label class="is-required">仓库：</label>-->
<!--                            <select id="warehouseId" name="warehouseId" th:with="type=${session.warehouse}">-->
<!--                                &lt;!&ndash;								<option   th:value="${session.warehouseId}" th:text="${@dict.getDictLabel('${session.warehouseId}')}"></option>&ndash;&gt;-->
<!--                                <option th:each="dict : ${type}" th:text="${dict.warehouseName}" th:value="${dict.warehouseId}"></option>-->
<!--                            </select>-->
<!--                        </li>-->

                        <li>
                            <label>仓库：</label>
                            <select name="warehouseId" th:with="type=${@dict.getType('is_house')}" required>
                                <!--<option value="">请选择</option>-->
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>

                        <li>
                            <label>货位编号：</label>
                            <input type="text" name="cargoSpaceId"/>
                        </li>
                        <li>
                            <label>批号：</label>
                            <input type="text" name="lotNo" />
                        </li>

                        <li>
                            <label>物品名称：</label>
                            <input type="text" name="productName">
                        </li>
                        <li >
                            <label>物品编号：</label>
                            <input type="text" name="productId"/>
                        </li>
                        <li >
                            <label>托盘条码：</label>
                            <input type="text" name="trayCode"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
        </div>
        <div class="col-sm-12 select-table table-bordered" style="overflow:scroll;width: 100%">
            <table id="bootstrap-table"class="table text-nowrap" style="min-width: 100%"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var product_status = [[${@dict.getType('product_status')}]];
    var warehouse = [[${@dict.getType('is_house')}]];
    var inType = [[${@dict.getType('in_or_out')}]];
    var prefix = ctx + "out/pandian";


    $(function () {
        var options = {
            url: "/stock/stock/list",

            clickToSelect: true,
            modalName: "库存",
            sortName:"inDate",
            height: $("#div").height() / 1,
            pageSize: 10,
            pageList: [10, 25, 50],
            columns: [{
                checkbox: true
            },
                {
                    field: 'stockId',
                    title: '库存编码',
                    halign: 'center',
                    align: 'center'
                },
                {
                    field: 'cargoSpaceId',
                    title: '货位编码',
                    halign: 'center',
                    align: 'center',
                    visible: false
                },
                {
                    field: 'cargoSpaceName',
                    title: '货位名称',
                    halign: 'center',
                    align: 'center'
                },
                {
                    field: 'trayCode',
                    title: '托盘条码',
                    halign: 'center',
                    align: 'center'
                },

                {
                    field: 'productId',
                    title: '物品编码',
                    halign: 'center',
                    align: 'center'
                },
                {
                    field: 'lineId',
                    title: '物品名称',
                    halign: 'center',
                    align: 'center'
                },
                {
                    field: 'lotNo',
                    title: '批号',
                    halign: 'center',
                    align: 'center'
                },
                {
                    field: 'productStatus',
                    title: '物品状态',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(product_status, value);
                    }
                },
                {
                    field: 'inClassName',
                    title: '供应商',
                    halign: 'center',
                    align: 'center'
                },
                {
                    field: 'quantity',
                    title: '库存数量',
                    halign: 'center',
                    align: 'center'
                }, {
                    field: 'inClassId',
                    title: '库存重量',
                    halign: 'center',
                    align: 'center'
                },
                {
                    field: 'classId',
                    title: '生产时间',
                    halign: 'center',
                    align: 'center'
                },
               {
                    field: 'stackingId',
                    title: '暂存单号',
                    align: 'center',

                },
            ]
        };
        $.table.init(options);
    });

    function result() {
        var row = $("#bootstrap-table").bootstrapTable('getSelections');
        return row;
    }
</script>
</body>
</html>